import request from '@/utils/request'

// 查询外部订单提交暂存列表
export function listSubmissions(query) {
    return request({
        url: '/dashboard/submissions/list',
        method: 'get',
        params: query
    })
}

// 查询外部订单提交暂存详细信息
export function getSubmissions(id) {
    return request({
        url: '/dashboard/submissions/' + id,
        method: 'get'
    })
}

// 删除外部订单提交暂存
export function delSubmissions(id) {
    return request({
        url: '/dashboard/submissions/' + id,
        method: 'delete'
    })
}

// 导出外部订单提交暂存
export function exportSubmissions(query) {
    return request({
        url: '/dashboard/submissions/export',
        method: 'post',
        params: query
    })
}

// 生成一个新的外部提交链接
export function createLink() {
    return request({
        url: '/dashboard/submissions/create-link',
        method: 'post'
    })
}

// 审核通过
export function approveSubmission(id) {
    return request({
        url: '/dashboard/submissions/approve/' + id,
        method: 'post'
    })
}

// 审核拒绝
export function rejectSubmission(id, data) {
    return request({
        url: '/dashboard/submissions/reject/' + id,
        method: 'post',
        data: data
    })
}
